﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using EnvDTE;
using Microsoft.Win32;

namespace EditorAutoClose
{
   public partial class OptionsPage : UserControl, IDTToolsOptionsPage
   {

      public OptionsPage()
      {
         InitializeComponent();
      }

      public void GetProperties(ref object PropertiesObject)
      {
      }

      public void OnAfterCreated(DTE DTEObject)
      {
         maxFiles.Text = Settings.MaxEditors.ToString();
      }

      public void OnCancel()
      {
      }

      public void OnHelp()
      {
      }

      public void OnOK()
      {
         int m;
         if (Int32.TryParse(maxFiles.Text, out m))
         {
            Settings.MaxEditors = m;
         }
      }
   }
}
